/*
 * @Author: wangc
 * @Date: 2021-03-15 12:54:06
 * @Description: 整经  8087
 */
import { request } from '@/utils/request'

// 接单   8087
export function getTaskAccept(data, callBack) {
    return request({
        url: '/task_step/accept',
        method: 'post',
        data,
        type: 'json',
        isYarn: true
    }, callBack)
}

// 接单   8087
export function getConfirmStep(data, callBack) {
    return request({
        url: '',
        method: 'get',
        data,
        isYarn: true,
        isResUrl: true
    }, callBack)
}

// 获取下一步信息
export function getNextInfo(data, callBack) {
    return request({
        url: '/flow_template/next_step',
        method: 'get',
        data,
        isYarn: true,
        isJoin: true
    }, callBack)
}

// 提交
export function getNextCommit(data, callBack) {
    return request({
        url: '/flow_task/commit',
        method: 'post',
        data,
        type: 'json',
        isYarn: true
    }, callBack)
}

// 胚布子流程
export function getTaskAcceptNext(data, callBack) {
    return request({
        url: '',
        method: 'get',
        data,
        isYarn: true,
        isResUrl: true
    }, callBack)
}

// 胚布子流程 2 
export function getTaskList(data, callBack) {
    return request({
        url: '',
        method: 'get',
        data,
        isYarn: true,
        isResUrl: true
    }, callBack)
}

// 挡车工长度
export function getBatchSave(data, callBack) {
    return request({
        url: '/weaving_grey_cloth_worker/batch_save',
        method: 'post',
        data,
        isYarn: true,
        type: 'json',
    }, callBack)
}


// 未登录 获取当前步骤
export function getTaskStepName(data, callBack) {
    return request({
        url: '/task_step/list_step_4_cur',
        method: 'get',
        data,
        isYarn: true
    }, callBack)
}

// 获取挡车工长度列表
export function getGreyClothWorker(data, callBack) {
    return request({
        url: '/weaving_grey_cloth_worker/get_by_grey_id',
        method: 'get',
        data,
        isYarn: true
    }, callBack)
}

// 获取用户信息
export function getWorkerInfo(data, callBack) {
    return request({
        url: '/dep_manage/get_worker',
        method: 'get',
        data,
        isUser: true,
        isId: true
    }, callBack)
}


// 获取绣字打印数据
// export function getGreyClothTask(data, callBack) {
//     return request({
//         url: '/grey_cloth/get_by_task',
//         method: 'get',
//         data,
//         isYarn: true
//     }, callBack)
// }


// 纱料包装废弃
export function getYarnPackageDrop(data, callBack) {
    return request({
        url: '/yarn_package/weaving_back_drop',
        method: 'post',
        data,
        isYarn: true,
        type: 'json',
    }, callBack)
}

// 纱料包装新增
export function getYarnPackageAdd(data, callBack) {
    return request({
        url: '/yarn_package/weaving_back_add',
        method: 'post',
        data,
        isYarn: true,
        type: 'json',
    }, callBack)
}

// resUrl 公共接口
export function getPublicData(data, callBack) {
    return request({
        url: '',
        method: 'get',
        data,
        isYarn: true,
        isResUrl: true,
        isReturn: true
    }, callBack)
}

// 穿棕/打结
export function getWeavingOptType(data, callBack) {
    return request({
        url: '/weaving_craft/assign_opt_type',
        method: 'post',
        data,
        isYarn: true,
        type: 'json'
    }, callBack)
}

// 穿棕/打结
export function getWeavingChangeOptType(data, callBack) {
    return request({
        url: '/weaving_craft/change_opt_type',
        method: 'post',
        data,
        isYarn: true,
        isFile: true
    }, callBack)
}

// 分配织机号
export function getWeavingLoom(data, callBack) {
    return request({
        url: '/weaving_craft/assign_loom',
        method: 'post',
        data,
        isYarn: true,
        type: 'json'
    }, callBack)
}

// 配置列表  获取织机号
export function getByType(data, callBack) {
    return request({
        url: '/prop/list',
        method: 'get',
        data
    }, callBack)
}

// 获取当前步骤
export function getCurStep(data, callBack) {
    return request({
        url: '/task_step/cur_step',
        method: 'get',
        data,
        isYarn: true
    }, callBack)
}

// 获取taskID
export function getCurTaskId(data, callBack) {
    return request({
        url: '/grey_cloth/task_id',
        method: 'get',
        data,
        isYarn: true
    }, callBack)
}

// 流程环节列表
export function getTaskStepList(data, callBack) {
    return request({
        url: '/task_step/list_steps',
        method: 'get',
        data,
        isYarn: true
    }, callBack)
}

// 环节数据
export function getGreyClothList(data, callBack) {
    return request({
        url: '/weaving_plan_data/get_cur_by_step',
        method: 'get',
        data,
        isYarn: true
    }, callBack)
}

// 子任务列表
export function getTaskDone(data, callBack) {
    return request({
        url: '/flow_task/list_task',
        method: 'get',
        data,
        isYarn: true
    }, callBack)
}

// 获取织机号
export function getWeavingByLoom(data, callBack) {
    return request({
        url: '/weaving_craft/loom_by_task',
        method: 'get',
        data,
        isYarn: true
    }, callBack)
}

// 修改织机号
export function getWeavingChangeLoom(data, callBack) {
    return request({
        url: '/weaving_craft/change_loom',
        method: 'post',
        data,
        isYarn: true,
        type: 'json'
    }, callBack)
}

// 获取标题
export function getWeavingTitleByTask(data, callBack) {
    return request({
        url: '/flow_task/title',
        method: 'get',
        data,
        isYarn: true
    }, callBack)
}

// 重新打印 获取资源接口
export function getWeavingClothByStepNo(data, callBack) {
    return request({
        url: '/weaving_grey_cloth_data/get_by_step_no',
        method: 'get',
        data,
        isYarn: true
    }, callBack)
}

// 设计管理 列表
export function getBySampleList(data, callBack) {
    return request({
        url: '/sample_design/filter_list',
        method: 'get',
        data,
        isYarn: true
    }, callBack)
}

// 根据taskId 获取 designNo
export function getDesignNOByTaskId(data, callBack) {
    return request({
        url: '/grey_cloth/get_by_task/',
        method: 'get',
        data,
        isYarn: true,
        isId: true
    }, callBack)
}

// 查询 经纱/纬沙 用量  type 0 / 1
export function getBySampleYarn(data, callBack) {
    return request({
        url: '/sample_yarn/list_by_form',
        method: 'get',
        data,
        isYarn: true
    }, callBack)
}

// 更换纬纱
export function getChangeLatYarn(data, callBack) {
    return request({
        url: '/grey_cloth/change_lat_yarn',
        method: 'post',
        data,
        isYarn: true,
        type: 'json'
    }, callBack)
}

// 余纱退回列表
export function getWeavingYarnBack(data, callBack) {
    return request({
        url: '/yarn_package/list_4_weaving_back',
        method: 'get',
        data,
        isYarn: true
    }, callBack)
}


export function getYarnStandardFilter(data, callBack) {
    return request({
        url: '/yarn_standard/filter',
        method: 'get',
        data,
        isJoin: true,
        isYarn: true,
        isReturn: true,
        isQs: true
    }, callBack)
}

// 获取筒管颜色
export function getSpindleColor(data, callBack) {
    return request({
        url: '/yarn_package/list_yarn_spindle_color',
        method: 'get',
        data,
        isYarn: true
    }, callBack)
}

// 纱料包装过滤
export function getYarnPackageFilter(data, callBack) {
    return request({
        url: '/yarn_package/get',
        method: 'get',
        data,
        isId: true,
        isYarn: true
    }, callBack)
}

// 根据规格ID获取批次
export function getYarnLotNumList(data, callBack) {
    return request({
        url: '/yarn_standard_batch/list',
        method: 'get',
        data,
        isYarn: true
    }, callBack)
}

// 根据taskId 获取纬纱信息
export function getQueryLatYarn(data, callBack) {
    return request({
        url: '/grey_cloth/query_lat_yarn',
        method: 'get',
        data,
        isYarn: true
    }, callBack)
}

// 更改坯布重量
export function getGreyClothWeight(data, callBack) {
    return request({
        url: '/grey_cloth/fix_weight',
        method: 'post',
        data,
        isYarn: true,
        type: 'json'
    }, callBack)
}

// 修改克重值
export function changeMarkMiWeight(data, callBack) {
    return request({
        url: '/weaving_craft/change_mark_mi_weight',
        method: 'post',
        data,
        isYarn: true,
    }, callBack)
}

// 根据taskId 获取纬纱信息
export function lastDataItem4Craft(data, callBack) {
    return request({
        url: '/weaving_produce_data/last_data_item_4_craft',
        method: 'get',
        data,
        isYarn: true
    }, callBack)
}

//盘头详情
export function weavingCraftDetail(data, callBack) {
    return request({
        url: "/weaving_craft_multi/craft_detail",
        method: 'get',
        data,
        isYarn: true
    }, callBack)
}